package com.zgroup.domain

class Setting {

  // 楼盘竞标
  BigDecimal bidUpset = new BigDecimal("10")                 //竞标底价(单位：分/点)
  BigDecimal bidIncrements = new BigDecimal("10")            //竞标加价幅度(单位：分/点)

  BigDecimal vipUpset = new BigDecimal("1000")                //VIP底价(单位：分/点)
  BigDecimal vipIncrements = new BigDecimal("100")            //竞标加价幅度(单位：分/点)

  Integer historySaveDays = 30              //历史记录保留时长(单位：天)
  Integer freeBidHours = 4                  //冠亚季军被挤不扣费时长(单位：小时)

  // 金额/积分/点券赠送
  BigDecimal registerMoneyPresented = new BigDecimal("0")    //注册金额赠送
  BigDecimal inviteMoneyPresented = new BigDecimal("0")      //邀请金额赠送
  BigDecimal photoMoneyPresented = new BigDecimal("0")       //照片上传金额赠送
  BigDecimal estateMoneyPresented = new BigDecimal("0")      //添加楼盘金额赠送

  BigDecimal registerPointPresented = new BigDecimal("1000")    //注册积分赠送
  BigDecimal invitePointPresented = new BigDecimal("300")       //邀请积分赠送
  BigDecimal photoPointPresented = new BigDecimal("50")         //照片上传积分赠送
  BigDecimal estatePointPresented = new BigDecimal("200")       //添加楼盘积分赠送

  BigDecimal registerCouponPresented = new BigDecimal("0")    //注册点券赠送
  BigDecimal inviteCouponPresented = new BigDecimal("0")      //邀请点券赠送
  BigDecimal photoCouponPresented = new BigDecimal("0")       //照片上传点券赠送
  BigDecimal estateCouponPresented = new BigDecimal("0")      //添加楼盘点券赠送

  // 信息发布
  Integer vipMaxInfoDispNum = 8              //VIP信息最大显示数
  Integer firstMaxInfoDispNum = 4            //冠军信息最大显示数
  Integer secondMaxInfoDispNum = 2           //亚军信息最大显示数
  Integer thirdMaxInfoDispNum = 1            //季军信息最大显示数

  int getBidUpsetInt() {
    bidUpset?.intValue()
  }

  int getBidIncrementsInt() {
    bidIncrements?.intValue()
  }

  int getVipUpsetInt() {
    vipUpset?.intValue()
  }

  int getVipIncrementsInt() {
    vipIncrements?.intValue()
  }

  int getRegisterMoneyPresentedInt() {
    registerMoneyPresented?.intValue()
  }

  int getInviteMoneyPresentedInt() {
    inviteMoneyPresented?.intValue()
  }

  int getPhotoMoneyPresentedInt() {
    photoMoneyPresented?.intValue()
  }

  int getEstateMoneyPresentedInt() {
    estateMoneyPresented?.intValue()
  }

  static transients = ["bidUpsetInt", "bidIncrementsInt", "vipUpsetInt", "vipIncrementsInt", "registerMoneyPresentedInt", "inviteMoneyPresentedInt", "photoMoneyPresentedInt", "estateMoneyPresentedInt"]

  static constraints = {
    bidUpset(blank: false, range: 0..99999999, scale: 2)
    bidIncrements(blank: false, range: 0..99999999, scale: 2)

    vipUpset(blank: false, range: 0..99999999, scale: 2)
    vipIncrements(blank: false, range: 0..99999999, scale: 2)

    historySaveDays(blank: false)
    freeBidHours(blank: false)

    registerMoneyPresented(blank: false, range: 0..99999999, scale: 2)
    inviteMoneyPresented(blank: false, range: 0..99999999, scale: 2)
    photoMoneyPresented(blank: false, range: 0..99999999, scale: 2)
    estateMoneyPresented(blank: false, range: 0..99999999, scale: 2)

    registerPointPresented(blank: false, range: 0..9999999999, scale: 0)
    invitePointPresented(blank: false, range: 0..9999999999, scale: 0)
    photoPointPresented(blank: false, range: 0..9999999999, scale: 0)
    estatePointPresented(blank: false, range: 0..9999999999, scale: 0)

    registerCouponPresented(blank: false, range: 0..9999999999, scale: 0)
    inviteCouponPresented(blank: false, range: 0..9999999999, scale: 0)
    photoCouponPresented(blank: false, range: 0..9999999999, scale: 0)
    estateCouponPresented(blank: false, range: 0..9999999999, scale: 0)
  }
}
